<%@ include file="/common/taglibs.jsp"%>
<title><fmt:message key="shippingMethodDetail.title" />
</title>
<content tag="buttons">
	<probiz:iconBtn btnType="save" onclick="return fnDoSave(this);" />
	<c:if test="${shippingMethod.shippingMethodId!=null}">
		<probiz:iconBtn btnType="delete" onclick="fnDoDelete(this)" />
	</c:if>
	<probiz:iconBtn btnType="back" url="${ctxPath }/system/shippingMethod.html" />
</content>

<div class="top clearfix">
	<ul class="tab">
		<li class="curr">
			<span><fmt:message key="shippingMethod.title" /> </span>
		</li>
	</ul>
</div>
<div class="modify">
	<form class="mainForm" method="post" target="_parent"
			action="<c:url value="/system/shippingMethod.html"/>" commandName="shippingMethod"
			name="shippingMethod" id="shippingMethod" onsubmit="return validateShippingMethod(this);">
			<spring:bind path="shippingMethod.shippingMethodId">
				<input type="hidden" name="shippingMethodId" value="<c:out value="${status.value}"/>" />
			</spring:bind>
	
			<table class="com_modi_table" cellSpacing=0 cellPadding=0 width="100%" border=0>
				<tr>
					<th colspan="2" class="title">
						<h4>
							<fmt:message key="shippingMethod.group.basic" />
						</h4>
					</th>
				</tr>
				<tr>
					<th width="120px">
						<StoreAdmin:label key="shippingMethod.shippingMethodName" />
					</th>
					<td>
						<spring:bind path="shippingMethod.shippingMethodName">
							<input type="text" name="${status.expression}" id="${status.expression}"
								value="${status.value}" class="inputtxt" style="width: 200px"/>
							<span class="fieldError">${status.errorMessage}</span>
						</spring:bind>
					</td>
				</tr>
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.carrierId" />
					</th>
					<td>
						<select name="carrierId" id="carrierId" />
							" style="width:200px" class="selecttxt">
							<c:forEach var="carrier" items="${carrierList}">
								<option value="<c:out value="${carrier.carrierId}"/>" <c:if test="${shippingMethod.carrier.carrierId == carrier.carrierId}">selected</c:if>>
									<c:out value="${carrier.carrierName}" />
								</option>
							</c:forEach>
						</select>
					</td>
				</tr>
	
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.deliveryTime" />
					</th>
					<td>
						<spring:bind path="shippingMethod.deliveryTime">
							<textarea name="${status.expression}" id="${status.expression}" class="textareatxt" rows="5"
								cols="80">${status.value}</textarea>
							<span class="fieldError">${status.errorMessage}</span>
						</spring:bind>
					</td>
				</tr>
	
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.supportSpecifyingDeliveryTime" />
					</th>
					<td>
						<spring:bind path="shippingMethod.supportSpecifyingDeliveryTime">
	
							<select name="<c:out value="${status.expression}"/>"
								id="<c:out value="${status.expression}"/>" style="width: 200px" class="selecttxt">
								<option value="1" <c:if test="${status.value == 1 }">selected</c:if>>
									<fmt:message key="common.message.yes" />
								</option>
								<option value="0"  <c:if test="${status.value == 0 }">selected</c:if>>
									<fmt:message key="common.message.no" />
								</option>
							</select>
							<span class="fieldError"><c:out value="${status.errorMessage}" /> </span>
						</spring:bind>
					</td>
				</tr>
	
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.CodCashOnDelivery" />
					</th>
					<td>
						<spring:bind path="shippingMethod.isCod">
	
							<select name="<c:out value="${status.expression}"/>"
								id="<c:out value="${status.expression}"/>" style="width: 200px" class="selecttxt">
								<option value="1" <c:if test="${status.value == 1 }">selected</c:if>>
									<fmt:message key="common.message.yes" />
								</option>
								<option value="0" <c:if test="${status.value == 0 }">selected</c:if>>
									<fmt:message key="common.message.no" />
								</option>
							</select>
							<probiz:plugin_tip id="dssdd">
								<fmt:message key="shippingMethod.CodCashOnDeliveryPrompt" />
							</probiz:plugin_tip>
							<span class="fieldError"><c:out value="${status.errorMessage}" /> </span>
						</spring:bind>
					</td>
				</tr>
	
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.shippingMethodDetail" />
					</th>
					<td>
						<spring:bind path="shippingMethod.shippingMethodDetail">
							<textarea name="${status.expression}" id="${status.expression}" class="textareatxt" rows="10"
								cols="80">${status.value}</textarea>
							<span class="fieldError">${status.errorMessage}</span>
						</spring:bind>
					</td>
				</tr>
				<tr>
					<th colspan="2" class="title">
						<h4>
							<fmt:message key="carrier.group.statusInfo" />
						</h4>
					</th>
				</tr>
				<tr>
					<th>
						<StoreAdmin:label key="shippingMethod.status" />
					</th>
					<td>
	
	
						<spring:bind path="shippingMethod.status">
							<select name="<c:out value="${status.expression}"/>"
								id="<c:out value="${status.expression}"/>" style="width: 200px" class="selecttxt">
								<option value="1" <c:if test="${status.value == 1 }">selected</c:if>>
									<fmt:message key="status.active" />
								</option>
								<option value="2" <c:if test="${status.value == 2 }">selected</c:if>>
									<fmt:message key="status.inactive" />
								</option>
							</select>
							<span class="fieldError"><c:out value="${status.errorMessage}" /> </span>
						</spring:bind>
					</td>
				</tr>
	
	
			</table>
	</form>
</div>
<v:javascript formName="shippingMethod" staticJavascript="false" />

<script>
function selectDefaultSelected(selectId,defaultVal){
 	if(trim(defaultVal)!=''){
 		$j('#'+selectId).attr("value",defaultVal); 
 	}
}
</script>